package com.itbaizhan;

import java.util.Random;
//测试枚举
public class TestEnum02 {
    public static void main(String[] args) {
       // System.out.println(SizeNumber.S);
        //System.out.println(SM.M);
        //遍历
        for(SM size:SM.values() ){
            System.out.println(size);
        }
        int b = new Random().nextInt(4);
        switch (SM.values()[b]){
            case S:
                System.out.println("小码");
                break;
            case M:
                System.out.println("中码");
                break;
            case L:
                System.out.println("大码");
                break;
            case XL:
                System.out.println("加大码");
        }
    }
}
//枚举
enum SM {
    S,M,L,XL
}

class SizeNumber {
    public static final int S = 0;
    public static final int M = 1;
    public static final int L = 2;
    public static final int XL = 3;
}